package au.com.evoCoach.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import au.com.evoCoach.dao.LeagueDAO;
import au.com.evoCoach.domain.League;

@Service
public class LeagueService {
	private LeagueDAO leagueDAO;
	
	private LeagueService() {}
	
	@Autowired
	public LeagueService(LeagueDAO leagueDAO) {
		this.leagueDAO = leagueDAO;
	}
	
	public List<League> getLeagues(int year) {
		return leagueDAO.getLeagues(year);
	}
	
	public League getLeague(int id) {
		return (League) leagueDAO.findById(id);
	}
}
